<%--
  Created by IntelliJ IDEA.
  User: 费阮敏
  Date: 2020/12/28
  Time: 13:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title></title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" type="text/css" href="/plugins/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="/css/nav.css">
</head>
<body>
<%--    引入导航    --%>
<%@ include file="../common/nav.jsp"%>
<%@ include file="../common/topimgs1.jsp"%>
<%@ include file="../common/changes.jsp"%>

<%--    主动去加载分页的数据--%>
<div id="outer">

</div>


<%--    在隐藏域中放入到session作用域中的用户--%>
<input type="hidden" value="${user.userName}" id="user_hidden">
<script src="/plugins/jquery/jquery.min.js"></script>
<script src="/plugins/bootstrap/js/bootstrap.js"></script>
<script src="/plugins/layui/layui.js"></script>
<script>
    function select_type(obj){
        //window.location="/mvc/product/index?typeId="+obj.value;

        $("#outer").load("/product/page_mai",{typeId:obj.value});
    }

    function searchs(){
        let name = $("#name_input").val();
        let type_id = $("#type_select").val();

        //window.location="/mvc/product/index?typeId="+type_id+"&name="+name;

        layui.use('layer', function(){
            var layer = layui.layer;

            layer.load(0);

            $("#outer").load("/product/page_mai",{typeId:type_id,name:name},function(data){
                layer.closeAll();
            });
        });


    }

    // 通过异步加载的方式去加载这个部分的分页的数据
    $(function(){
        $("#outer").load("/product/page_mai");
    })

</script>
<%@ include file="../common/dibu.jsp"%>

</body>
</html>
